using System;
using System.Collections.Generic;
using System.Text;

namespace CommonLayer.LogManagement
{
    public class ExceptionFilter
    {
        public static readonly string ThreadAborted = @"thread was being aborted";
        public static readonly string UnableToValidateData = @"unable to validate data";

        public static int IsAccept(string requestURL, string exceptionContent)
        {
            string strFilter = requestURL.Trim().ToLower();
            if (strFilter.StartsWith(ThreadAborted) ||
                strFilter.StartsWith(UnableToValidateData))
            {
                return -1;
            }
            else if(exceptionContent.Trim().ToLower().StartsWith(ThreadAborted) ||
                exceptionContent.Trim().ToLower().StartsWith(UnableToValidateData) )
            {
                return 0;
            }
            else
            {
                return 1;
            }
        }
    }
}
